In modern times, as the living standard of people improves, video applications are increasingly widely applied in both Internet transmission and handheld terminal playback. However, because an existing transmission bandwidth is limited, it is required that a video bandwidth is compressed and the coding efficiency is improved as much as possible. In addition, some devices such as a television terminal have a high requirement on a frame rate during video playback, but a limited bandwidth determines that a high frame rate cannot be reached during transmission. Therefore, to achieve an effect of smooth playback, a frame rate conversion module or the like needs to be added, and in this case, effective video processing is required, so as to achieve an ideal effect.
In video technology application, because motion estimation is a common method for eliminating video redundancy, motion estimation is needed for both video coding and decoding and video processing. However, in a specific scenario, pixel based motion estimation match has a rather high requirement on pixel precision. If fade-in/fade-out or the like occurs, match accuracy is affected. Therefore, to improve motion estimation match accuracy, we need to detect a fade-in/fade-out scenario to perform effective processing.
A known method provides a video frame detection method, including collecting statistics on pixels of a single-frame picture of a video to obtain a histogram of the pixels of the picture, where the histogram identifies the number of occurrences of each pixel in a single-frame picture; comparing a relationship between histograms of contiguous frames to determine similarity of the histograms and an overall offset of an inter-frame direct current component. The method also includes determining whether fade-in/fade-out exists in a current video frame; and if the fade-in/fade-out exists, using a weighted prediction method during motion estimation match, so as to improve match accuracy.
It is found that this method has at least the following defects. First, in this method, entire-frame detection needs to be first performed according to a current picture and a reference frame, and processing is then performed; therefore, a delay exists. Second, during hardware implementation, a picture needs to be first loaded to perform fade-in/fade-out detection, and picture data needs to be loaded again during motion estimation match; therefore, the burden of bandwidth is increased. Finally, in this method, only a global fade-in/fade-out case is considered, and detection and processing on local fade-in/fade-out cannot be performed.
Another known method considers both global fade-in/fade-out and local fade-in/fade-out. The method includes calculating a residual by using both a direct match method and a weighted prediction method during motion estimation match, then comparing the residuals of the two methods; and then selecting a method having a smaller residual, and marking whether weighted prediction is used.
According to this method, the inventor finds that defects of this method are also rather obvious. That is, if this prior art is applied to the frame rate conversion module, this method is very likely to cause wrong estimation on local fade-in/fade-out in a case without local fade-in/fade-out, thereby affecting motion vector calculation accuracy.